home *** CD-ROM | disk | FTP | other *** search
- Path: zk2nws.zko.dec.com!usenet
- From: Alexander Goykhman USG <goykhman@zk3.dec.com>
- Newsgroups: comp.lang.c++
- Subject: Re: const member functions
- Date: 10 Apr 1996 17:47:40 GMT
- Organization: CTG
- Message-ID: <4kgs7s$vb4@zk2nws.zko.dec.com>
- References: <316588E6.7D61@geoplex.com>
- NNTP-Posting-Host: odessa.zk3.dec.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.12I (X11; I; OSF1 T4.0 alpha)
- X-URL: news:316588E6.7D61@geoplex.com
-
- "Jay B. Perry" <jay@geoplex.com> wrote:
-
- >class X
- >{
- >public: // Public methods
-
- > int value( ) const { return _value; }
- >
- >private: // Private methods
- >
- > int& value( ) { return _value; }
-
-
- I don't see how a compiler could possibly
- distinguish between:
-
- int value()
-
- and
-
- int& value()
-
-
- IMO, the above is ambiguous and ought to be
- flagged as such by the compiler.
-
-